var randInt = Mathf.RoundToInt(random);
var randomClips : AudioClip[];
var hurtClips : AudioClip[];
var hitClips : AudioClip[];
var playAtRandomTime : boolean = false;
var minInternal : int = 30;
var maxInternal : int = 120;

 var random = 0;
 var currentTime = 0;


function PlayRandom(clips : AudioClip[]){

var random = Random.Range(0, clips.length);
var randInt = Mathf.RoundToInt(random);

Debug.Log(random + " " + randInt);

//audio.clip = clips[randInt];
// Play default sound
audio.PlayOneShot(clips[randInt]);
}

function Start(){

  currentTIme = Time.time;

}

function Update(){
  
  if(playAtRandomTime){
    if(Time.time > random + currentTime){
    random = Random.Range(minInternal , maxInternal);
    currentTime = Time.time;
    PlayRandom(randomClips);
    }
  }
}

function HurtSound(){
  PlayRandom(hurtClips);
}


function HitSound(){
  PlayRandom(hitClips);
}